<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>注册表单-02</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
    <link rel="stylesheet" href="../js/lay-module/step-lay/step.css" media="all">
    <link rel="icon" href="images/logome.ico">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <div class="layui-fluid">
            <div class="layui-card">
                <div class="layui-card-body" style="padding-top: 40px;">
                    <div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
                        <div carousel-item>
                        <div>
                                <form class="layui-form" style="margin: 0 auto;max-width: 460px;padding-top: 40px;" >
                                <p id="msg" th:text="${msg}" th:if="${! #strings.isEmpty(msg)}" 
                                style="text-align:center;color:#009688;font-size:18px;margin-top:-30px;margin-bottom:20px"></p>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">昵称:</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="name" placeholder="请填写入昵称" th:value="${user.name}" 
                                            class="layui-input" lay-verify="" required />

                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">用户名:</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="username" placeholder="请填写入用户名" th:value="${user.username}"
                                             class="layui-input" lay-verify="" required />
                                        </div>
                                    </div>
                                    
                                     <div class="layui-form-item">
                                        <label class="layui-form-label">性别:</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="sex" placeholder="请填写入性别" th:value="${user.sex}"
                                             class="layui-input" lay-verify="" required />
                                        </div>
                                    </div>
                                    
                                     <div class="layui-form-item">
                                        <label class="layui-form-label">身份:</label>
                                        <div class="layui-input-block" name="status">
                                            <input type="text" name=status placeholder="请填写入身份" th:value="${user.status}"
                                             class="layui-input" lay-verify="" required />
                                        </div>
                                    </div>
                                    
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">密 码:</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="password" placeholder="请填写入密码" th:value="${user.password}"
                                             class="layui-input" lay-verify="" required />
                                        </div>
                                    </div>
                                    
                                     <div class="layui-form-item">
                                        <label class="layui-form-label">确认密码:</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="confirmPassword" placeholder="请确认密码" th:value="${user.confirmPassword}"
                                             class="layui-input" lay-verify="" required>
                                        </div>
                                    </div>
                                   
                                    <div class="layui-form-item">
					                    <label class="layui-form-label">注册日期</label>
					                    <div class="layui-input-block">
					                        <input type="text" name="date" id="date" lay-verify="date" th:value="${user.date}"
					                         placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input" required />
					                    </div>
					                </div>
                                    <div class="layui-form-item">
                                        <div class="layui-input-block">
                                         	<a href="/register" class="layui-btn layui-btn-primary">
                                             	 &emsp;上一步 &emsp;
                                            </a>
                                            <button class="layui-btn" lay-submit lay-filter="formStep">
                                                &emsp;确认信息&emsp;
                                            </button>
                                            
                                        </div>
                                    </div>
                                    
                                </form>
                            </div>
                            
                           <!-- <th:form> -->
                            <!-- 确认信息 -->
                            <div>    
                              <form class="layui-form" id="sub" th:action="@{/doRegister}" th:method="post" style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">昵称:</label>
                                        <div class="layui-input-block">
                                            <div class="layui-form-mid layui-word-aux" th:text="${user.name}" ></div>
                                             <input type="hidden" name="name" placeholder="请填写入昵称" th:value="${user.name}" 
                                            class="layui-input" lay-verify="" required />
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">用户名:</label>
                                        <div class="layui-input-block">
                                            <div class="layui-form-mid layui-word-aux" th:text="${user.username}"></div>
                                            <input type="hidden" name="username" placeholder="请填写入用户名" th:value="${user.username}"
                                             class="layui-input" lay-verify="" required />
                                        </div>
                                    </div>
                                    
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">性别:</label>
                                        <div class="layui-input-block">
                                            <div class="layui-form-mid layui-word-aux" th:text="${user.sex}"></div>
                                            <input type="hidden" name="sex" placeholder="请填写入性别" th:value="${user.sex}"
                                             class="layui-input" lay-verify="" required />
                                        </div>
                                    </div>
                                    
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">身份:</label>
                                        <div class="layui-input-block">
                                            <div class="layui-form-mid layui-word-aux" th:text="${user.status}"></div>
                                            <input type="hidden" name="status" placeholder="请填写入身份" th:value="${user.status}"
                                             class="layui-input" lay-verify="" required />
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">密码:</label>
                                        <div class="layui-input-block">
                                            <div class="layui-form-mid layui-word-aux">
                                                <span style="font-size: 18px;color: #333;" th:text="${user.password}"></span>
                                                <input type="hidden" name="password" placeholder="请填写入密码" th:value="${user.password}"
                                             class="layui-input" lay-verify="" required />
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">确认日期:</label>
                                        <div class="layui-input-block">
                                            <div class="layui-form-mid layui-word-aux" th:text="${user.date}"></div>
                                            <input type="hidden" name="date" id="date" lay-verify="date" th:value="${user.date}"
					                         placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input" required />
                                        </div>
                                    </div>
                                  
                                    <div class="layui-form-item">
                                        <div class="layui-input-block">
                                            <a href="javasrcipt:;"><button type="button" class="layui-btn layui-btn-primary pre">上一步</button></a>
                                            <a href=""><button class="layui-btn"  lay-filter="formStep2" id="formStep2" type="submit">
                                                &emsp;确认注册&emsp;
                                            </button></a>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div>
                                <div style="text-align: center;margin-top: 90px;">
                                    <i class="layui-icon layui-circle"
                                       style="color: white;font-size:30px;font-weight:bold;background: #52C41A;padding: 20px;line-height: 80px;">&#xe605;</i>
                                    <div style="font-size: 24px;color: #333;font-weight: 500;margin-top: 30px;">
                                        注册成功
                                    </div>
                                    <div style="font-size: 14px;color: #666;margin-top: 20px;">点击完成，去到登录</div>
                                </div>
                                <div style="text-align: center;margin-top: 50px;">
                                    <button class="layui-btn next"  type="submit">完成</button>
                                </div>
                            </div> 
                          <!-- </th:form> -->
                            
                        </div>
                    </div>
                    <hr>
                    <div style="color: #666;margin-top: 30px;margin-bottom: 40px;padding-left: 30px;">
                        <h3></h3><br>
                        <h4></h4>
                        <p></p>
                        <br><h4></h4>
                        <p></p>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<script src="lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script src="js/jquery-1.9.js" charset="utf-8"></script>
<script src="js/date.js" charset="utf-8"></script>
<script>
layui.use([ 'form', 'step'], function () {
    var $ = layui.$,
        form = layui.form,
        step = layui.step;

    step.render({
        elem: '#stepForm',
        filter: 'stepForm',
        width: '100%', //设置容器宽度
        stepWidth: '750px',
        height: '500px',
        stepItems: [{
            title: '填写注册信息'
        }, {
            title: '确认注册信息'
        }, {
            title: '完成'
        }]
    });


    form.on('submit(formStep)', function (data) {
        step.next('#stepForm');
        return false;
    });

    form.on('submit(formStep2)', function (data) {
        step.next('#stepForm');
        /* $("#sub").submit(); */
        return false;
    });

    $('.pre').click(function () {
        step.pre('#stepForm');
    });

    $('.next').click(function () {
        step.next('#stepForm');
    });
})
 function sub() {
	$("#sub").submit();
 }
 /* onclick="sub()" */
</script>
</body>
</html>